<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<% 

String filePath ="D:/servers/apache-tomcat-6.0.16/webapps/webform/UserFiles/replies/20080805/1217906827828.rar";
response.setContentType("unknown"); 
response.addHeader("Content-Disposition",   "filename=\""   +   fileName   +   "\"");     
java.io.OutputStream      os   =   null;   
java.io.FileInputStream   fis =   null;   
try{     
   os   =   response.getOutputStream();     
   fis =   new java.io.FileInputStream(filePath);     

   byte[]   b   =   new   byte[8192];     
   int      i   =   0;     

   while   (   (i   =   fis.read(b))   >   0   ){     
     os.write(b,   0,   i);     
   }     
   os.flush();     
}   
catch(Exception e ) {

out.println("you have catched the exception");
}   
finally{   
   if(fis   !=   null){   
   fis.close();   
    fis   =   null;   
    }   
    if(os != null){   
       os.close();   
       os=null;   
    }   
} 
%>